// useropt
package servicerequest

import (
	//	"log"
	"net/http"
	_ "swim/contain"
	"swim/util"
)

func OnServiceUser(w http.ResponseWriter, r *http.Request) {
	if r.Method == "GET" {
		query := r.URL.Query()
		get_act := query.Get("act")
		if get_act != "" {
			switch get_act {
			case "listuserview":
				onListUserView(w, r)
			case "listuser":
				onListUser(w, r)
			}
		}
	} else {

	}
}

func onListUserView(w http.ResponseWriter, r *http.Request) {
	login_id := r.FormValue("login_id") //登录ID
	if !checkSID(login_id) {
		return
	}
	locals := make(map[string]interface{})
	locals["login_id"] = login_id
	util.RenderHtml(w, "listuser", locals)
}

func onListUser(w http.ResponseWriter, r *http.Request) {
	login_id := r.FormValue("login_id") //登录ID
	if !checkSID(login_id) {
		return
	}
	//找到所属服务组
	/*
		sUser, bFind := contain.G_servieceGroup.FindClientByLoginId(login_id)
		if bFind {
			sGroupAccount := sUser.User.Group.Account

		}*/
}
